@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Roboto:wght@300;400;500&display=swap');
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            background-color: #050505;
            color: #fff;
            font-family: 'Roboto', sans-serif;
            overflow-x: hidden;
            height: 100vh;
            position: relative;
        }
        /* 背景星空效果 */
        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(ellipse at center, #0a0a0a 0%, #000000 70%);
            z-index: -2;
        }
        .star {
            position: absolute;
            background-color: #fff;
            border-radius: 50%;
            animation: twinkle 3s infinite ease-in-out;
            z-index: -1;
        }
        @keyframes twinkle {
            0%, 100% { opacity: 0.2; }
            50% { opacity: 1; }
        }
        /* 主容器 */
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
            position: relative;
            z-index: 10;
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        header {
            text-align: center;
            margin-bottom: 3rem;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        /* 侧边栏按钮 */
        .sidebar-toggle {
            position: absolute;
            left: 0;
            background: none;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            z-index: 20;
        }
        /* 个人按钮 */
        .user-menu {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 1000;
        }
        .user-btn {
            display: flex;
            align-items: center;
            background: rgba(30, 30, 30, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: #fff;
            padding: 0.5rem 1rem;
            cursor: pointer;
            font-family: 'Roboto', sans-serif;
            transition: all 0.3s ease;
        }
        .user-btn:hover {
            background: rgba(102, 126, 234, 0.2);
            border-color: #667eea;
        }
        .user-icon {
            margin-right: 0.5rem;
            font-size: 1.2rem;
        }
        /* 下拉菜单 */
        .user-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            background: rgba(25, 25, 25, 0.95);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            width: 250px;
            z-index: 100;
            display: none;
        }
        /* 个人资料弹窗 */
        .profile-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 2000;
            justify-content: center;
            align-items: center;
        }
        .modal-content {
            background: rgba(30, 30, 30, 0.95);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.5rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        .modal-header h2 {
            margin: 0;
            font-size: 1.5rem;
            color: #fff;
        }
        .close-btn {
            font-size: 2rem;
            color: #aaa;
            cursor: pointer;
            transition: color 0.3s ease;
        }
        .close-btn:hover {
            color: #fff;
        }
        .modal-body {
            padding: 1.5rem;
        }
        .form-group {
            margin-bottom: 1.5rem;
        }
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: #ddd;
            font-weight: 500;
        }
        .form-control {
            width: 100%;
            padding: 0.8rem;
            background: rgba(20, 20, 20, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            color: #fff;
            font-family: 'Roboto', sans-serif;
            font-size: 1rem;
            outline: none;
            transition: all 0.3s ease;
        }
        .form-control:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
        }
        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
            padding: 1.5rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }
        .btn {
            padding: 0.7rem 1.5rem;
            border: none;
            border-radius: 6px;
            font-family: 'Roboto', sans-serif;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .btn-secondary {
            background: rgba(100, 100, 100, 0.3);
            color: #ddd;
        }
        .btn-secondary:hover {
            background: rgba(100, 100, 100, 0.5);
        }
        .btn-primary {
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        }
        .user-dropdown.show {
            display: block;
        }
        .dropdown-header {
            display: flex;
            align-items: center;
            padding: 1rem;
        }
        .dropdown-header .user-icon {
            font-size: 2rem;
            margin-right: 1rem;
        }
        .dropdown-username {
            font-weight: 500;
            color: #fff;
            margin-bottom: 0.2rem;
        }
        .dropdown-email {
            font-size: 0.8rem;
            color: #aaa;
        }
        .dropdown-divider {
            height: 1px;
            background: rgba(255, 255, 255, 0.1);
            margin: 0.5rem 0;
        }
        .dropdown-item {
            display: block;
            padding: 0.8rem 1rem;
            color: #ddd;
            text-decoration: none;
            font-size: 0.9rem;
            transition: all 0.2s ease;
        }
        .dropdown-item:hover {
            background: rgba(102, 126, 234, 0.2);
            color: #fff;
        }
        h1 {
            font-family: 'Orbitron', sans-serif;
            font-size: 2.8rem;
            font-weight: 700;
            letter-spacing: 3px;
            margin-bottom: 1rem;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
        }
        .subtitle {
            font-size: 1.1rem;
            color: #aaa;
            max-width: 600px;
            margin: 0 auto;
            line-height: 1.6;
        }
        /* 搜索区域 */
        .search-section {
            background: rgba(15, 15, 15, 0.7);
            backdrop-filter: blur(10px);
            border-radius: 16px;
            padding: 2.5rem;
            margin-bottom: 3rem;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        }
        .search-container {
            display: flex;
            gap: 1rem;
            margin-bottom: 2rem;
        }
        .search-input {
            flex: 1;
            padding: 1rem 1.5rem;
            background: rgba(30, 30, 30, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: #fff;
            font-size: 1rem;
            font-family: 'Roboto', sans-serif;
            outline: none;
            transition: all 0.3s ease;
        }
        .search-input:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
        }
        .search-btn {
            padding: 0 2rem;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-family: 'Orbitron', sans-serif;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        .search-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        }
        .characters-container {
            position: relative;
            width: 100%;
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 4rem; /* 增大间距 */
            margin-top: 2rem;
        }
        /* 角色包装器 */
        .character-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            transition: all 0.3s ease;
            cursor: pointer;
        }
        .character-wrapper:hover {
            z-index: 100;
            transform: scale(1.05);
        }
        .character-blackhole {
            position: relative;
            width: 300px;
            height: 300px;
            margin: 0 auto;
            transition: all 0.3s ease;
        }
        .blackhole-core {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 120px;
            height: 120px;
            background: radial-gradient(circle, #0a0a0a 0%, #000000 60%, transparent 100%);
            border-radius: 50%;
            box-shadow: 
                0 0 40px 8px rgba(66, 133, 244, 0.2),
                inset 0 0 30px rgba(0, 0, 0, 0.9),
                0 0 80px 20px rgba(118, 75, 162, 0.1);
            z-index: 2;
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255, 255, 255, 0.8);
            font-family: 'Orbitron', sans-serif;
            font-weight: 700;
            font-size: 24px;
            text-align: center;
            text-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
            border: 2px solid rgba(102, 126, 234, 0.3);
        }
        .event-horizon {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 220px;
            height: 220px;
            border-radius: 50%;
            border: 2px solid rgba(102, 126, 234, 0.2);
            animation: pulse-ring 4s infinite ease-in-out;
            z-index: 1;
        }
        @keyframes pulse-ring {
            0%, 100% { 
                transform: translate(-50%, -50%) scale(1);
                opacity: 0.5;
            }
            50% { 
                transform: translate(-50%, -50%) scale(1.2);
                opacity: 0.8;
            }
        }
        /* 角色信息 */
        .character-info {
            text-align: center;
            margin-top: 2rem;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .character-name {
            font-family: 'Orbitron', sans-serif;
            font-size: 1.4rem;
            color: #fff;
            text-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
            margin-bottom: 0.8rem;
        }
        .character-description {
            font-size: 1rem;
            color: #aaa;
            max-width: 300px;
            line-height: 1.5;
        }
        /* 粒子系统 */
        /* .particles-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
        }
        .particle {
            position: absolute;
            pointer-events: none;
            border-radius: 50%;
            z-index: 1;
        } */
         /* 粒子定位层 */
        .particle-wrapper {
            position: absolute;
            /* 定位的基准点在容器左上角 */
            top: 50%;
            left: 50%;
            /* transform 将从这个中心基准点开始移动粒子 */
        }

        /* 粒子视觉与动画层 */
        .particle-inner {
            position: absolute;
            /* 自身的偏移修正，确保粒子图像的中心就是它的坐标点 */
            transform: translate(-50%, -50%);
            border-radius: 50%;
        }

        /* 通用的、原地旋转的动画 */
        @keyframes spin-in-place {
            from {
                transform: translate(-50%, -50%) rotate(0deg);
            }
            to {
                transform: translate(-50%, -50%) rotate(360deg);
            }
        }

        /* 脉冲动画 */
        @keyframes pulse {
            from {
                opacity: 0.3;
            }
            to {
                opacity: 0.8;
            }
        }
        /* 聊天界面 - 左侧角色黑洞 + 右侧聊天框 */
        .chat-interface {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(5, 5, 5, 0.95);
            z-index: 1000;
            padding: 2rem;
            overflow: hidden;
        }
        .chat-container {
            display: flex;
            height: 100%;
            gap: 2rem;
        }
        /* 左侧角色黑洞 */
        .left-character-section {
            flex: 0 0 350px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .large-character-blackhole {
            position: relative;
            width: 300px;
            height: 300px;
            margin-bottom: 2rem;
        }
        .large-blackhole-core {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 120px;
            height: 120px;
            background: radial-gradient(circle, #0a0a0a 0%, #000000 60%, transparent 100%);
            border-radius: 50%;
            box-shadow: 
                0 0 40px 8px var(--character-color-transparent),
                inset 0 0 30px rgba(0, 0, 0, 0.9),
                0 0 80px 20px var(--character-color-transparent);
            z-index: 2;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--character-color);
            font-family: 'Orbitron', sans-serif;
            font-weight: 700;
            font-size: 24px;
            text-align: center;
            text-shadow: 0 0 15px var(--character-color-transparent);
            border: 2px solid var(--character-color-transparent);
        }
        .large-event-horizon {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 220px;
            height: 220px;
            border-radius: 50%;
            border: 2px solid var(--character-color-transparent);
            animation: pulse-ring 3s infinite ease-in-out;
            z-index: 1;
        }
        .character-title {
            font-family: 'Orbitron', sans-serif;
            font-size: 2rem;
            font-weight: 700;
            color: var(--character-color);
            text-shadow: 0 0 15px var(--character-color-transparent);
            margin-bottom: 0.5rem;
            text-align: center;
        }
        .character-bio {
            color: #aaa;
            font-size: 1rem;
            text-align: center;
            max-width: 300px;
            line-height: 1.5;
        }
        /* 右侧聊天框 */
        .right-chat-section {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: rgba(15, 15, 15, 0.7);
            backdrop-filter: blur(10px);
            border-radius: 16px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            overflow: hidden;
        }
        .chat-header {
            padding: 1.5rem 2rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .chat-title {
            font-family: 'Orbitron', sans-serif;
            font-size: 1.3rem;
            font-weight: 600;
        }
        .close-chat-btn {
            background: rgba(255, 255, 255, 0.1);
            border: none;
            color: #fff;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }
        .close-chat-btn:hover {
            background: rgba(255, 100, 100, 0.3);
            transform: rotate(90deg);
        }
        .chat-messages-container {
            flex: 1;
            padding: 0 2rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1.2rem;
            padding-top: 2rem;
            padding-bottom: 2rem;
        }
        .message {
            padding: 1rem 1.5rem;
            border-radius: 12px;
            max-width: 80%;
            animation: fadeIn 0.3s ease;
            position: relative;
            line-height: 1.5;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .message.ai {
            background: rgba(50, 50, 50, 0.5);
            align-self: flex-start;
            border-left: 3px solid var(--character-color);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
        }
        .message.user {
            background: rgba(var(--character-rgb), 0.15);
            align-self: flex-end;
            border-right: 3px solid var(--character-color);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
        }
        .chat-input-section {
            padding: 1.5rem 2rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            gap: 1rem;
        }
        .chat-text-input {
            flex: 1;
            padding: 1rem 1.5rem;
            background: rgba(30, 30, 30, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: #fff;
            font-size: 1rem;
            outline: none;
            resize: none;
            height: 60px;
            font-family: 'Roboto', sans-serif;
        }
        .chat-text-input:focus {
            border-color: var(--character-color);
            box-shadow: 0 0 0 2px var(--character-color-transparent);
        }
        .send-btn, .voice-btn {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .send-btn {
            background: linear-gradient(45deg, var(--character-color), var(--character-color-dark));
            color: white;
        }
        .voice-btn {
            background: linear-gradient(45deg, #7bed9f, #2ed573);
            color: white;
        }
        .send-btn:hover, .voice-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 0 20px var(--character-color-transparent);
        }
        .send-icon, .voice-icon {
            width: 24px;
            height: 24px;
            fill: white;
        }
        /* 侧边栏样式 */
        .sidebar {
            position: fixed;
            top: 0;
            left: -300px;
            width: 300px;
            height: 100%;
            background: rgba(15, 15, 15, 0.95);
            backdrop-filter: blur(10px);
            border-right: 1px solid rgba(255, 255, 255, 0.1);
            z-index: 1100;
            transition: left 0.3s ease;
            overflow-y: auto;
            padding: 20px;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
        }
        .sidebar.open {
            left: 0;
        }
        .sidebar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        .sidebar-title {
            font-family: 'Orbitron', sans-serif;
            font-size: 1.2rem;
            font-weight: 600;
        }
        .close-sidebar-btn {
            background: none;
            border: none;
            color: #aaa;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 5px;
        }
        .close-sidebar-btn:hover {
            color: #fff;
        }
        .history-list {
            list-style: none;
        }
        .history-item {
            padding: 12px 15px;
            margin-bottom: 10px;
            background: rgba(30, 30, 30, 0.6);
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.05);
        }
        .history-item:hover {
            background: rgba(50, 50, 50, 0.8);
        }
        .history-item.active {
            background: rgba(102, 126, 234, 0.2);
            border: 1px solid rgba(102, 126, 234, 0.3);
        }
        .history-character {
            font-family: 'Orbitron', sans-serif;
            font-size: 0.9rem;
            color: #667eea;
            margin-bottom: 5px;
        }
        .history-preview {
            font-size: 0.85rem;
            color: #aaa;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .no-history {
            color: #777;
            text-align: center;
            font-style: italic;
            padding: 20px 0;
        }
        /* 遮罩层 */
        .overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1050;
        }
        /* 响应式设计 */
        @media (max-width: 1024px) {
            .chat-container {
                flex-direction: column;
            }
            .left-character-section {
                flex: 0 0 auto;
                margin-bottom: 2rem;
            }
            .large-character-blackhole {
                width: 250px;
                height: 250px;
            }
            .large-blackhole-core {
                width: 100px;
                height: 100px;
                font-size: 20px;
            }
            .large-event-horizon {
                width: 180px;
                height: 180px;
            }
        }
        @media (max-width: 768px) {
            .container {
                padding: 1rem;
            }
            h1 {
                font-size: 2rem;
            }
            .search-section {
                padding: 1.5rem;
            }
            .characters-container {
                flex-direction: column;
                gap: 2rem;
            }
            .character-blackhole {
                width: 250px;
                height: 250px;
            }
            .blackhole-core {
                width: 100px;
                height: 100px;
                font-size: 20px;
            }
            .event-horizon {
                width: 180px;
                height: 180px;
            }
            .character-info {
                margin-top: 1.5rem;
            }
            .character-name {
                font-size: 1.2rem;
                margin-bottom: 0.5rem;
            }
            .character-description {
                font-size: 0.9rem;
                max-width: 250px;
            }
            .chat-interface {
                padding: 1rem;
            }
            .chat-header {
                padding: 1rem;
            }
            .chat-messages-container {
                padding: 1rem;
                padding-top: 1.5rem;
                padding-bottom: 1.5rem;
            }
            .chat-input-section {
                padding: 1rem;
            }
            /* 移动端侧边栏适配 */
            .sidebar {
                width: 280px;
            }
        }